package com.flink.hbase.doris.config;

import java.io.Serializable;

/**
 * Doris连接配置类
 * 用于配置Flink-Doris连接器的各种参数
 */
public class DorisConnectionConfig implements Serializable {
    
    private String fenodes;
    private String benodes;
    private String username;
    private String password;
    private String database;
    private String table;
    
    // 读取配置
    private Integer readBatchSize = 1024;
    private Integer requestRetries = 3;
    private Integer requestConnectTimeoutMs = 30000;
    private Integer requestReadTimeoutMs = 30000;
    private Integer requestQueryTimeoutS = 3600;
    
    // 写入配置
    private Integer batchSize = 1000;
    private Long batchIntervalMs = 1000L;
    private Integer maxRetries = 3;
    private String streamLoadFormat = "json";
    
    /**
     * 构造函数
     */
    public DorisConnectionConfig() {}
    
    /**
     * 构造函数
     * @param fenodes FE节点地址
     * @param username 用户名
     * @param password 密码
     * @param database 数据库名
     * @param table 表名
     */
    public DorisConnectionConfig(String fenodes, String username, String password, String database, String table) {
        this.fenodes = fenodes;
        this.username = username;
        this.password = password;
        this.database = database;
        this.table = table;
    }
    
    // Getters and Setters
    public String getFenodes() { return fenodes; }
    public void setFenodes(String fenodes) { this.fenodes = fenodes; }
    
    public String getBenodes() { return benodes; }
    public void setBenodes(String benodes) { this.benodes = benodes; }
    
    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }
    
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }
    
    public String getDatabase() { return database; }
    public void setDatabase(String database) { this.database = database; }
    
    public String getTable() { return table; }
    public void setTable(String table) { this.table = table; }
    
    public Integer getReadBatchSize() { return readBatchSize; }
    public void setReadBatchSize(Integer readBatchSize) { this.readBatchSize = readBatchSize; }
    
    public Integer getRequestRetries() { return requestRetries; }
    public void setRequestRetries(Integer requestRetries) { this.requestRetries = requestRetries; }
    
    public Integer getRequestConnectTimeoutMs() { return requestConnectTimeoutMs; }
    public void setRequestConnectTimeoutMs(Integer requestConnectTimeoutMs) { this.requestConnectTimeoutMs = requestConnectTimeoutMs; }
    
    public Integer getRequestReadTimeoutMs() { return requestReadTimeoutMs; }
    public void setRequestReadTimeoutMs(Integer requestReadTimeoutMs) { this.requestReadTimeoutMs = requestReadTimeoutMs; }
    
    public Integer getRequestQueryTimeoutS() { return requestQueryTimeoutS; }
    public void setRequestQueryTimeoutS(Integer requestQueryTimeoutS) { this.requestQueryTimeoutS = requestQueryTimeoutS; }
    
    public Integer getBatchSize() { return batchSize; }
    public void setBatchSize(Integer batchSize) { this.batchSize = batchSize; }
    
    public Long getBatchIntervalMs() { return batchIntervalMs; }
    public void setBatchIntervalMs(Long batchIntervalMs) { this.batchIntervalMs = batchIntervalMs; }
    
    public Integer getMaxRetries() { return maxRetries; }
    public void setMaxRetries(Integer maxRetries) { this.maxRetries = maxRetries; }
    
    public String getStreamLoadFormat() { return streamLoadFormat; }
    public void setStreamLoadFormat(String streamLoadFormat) { this.streamLoadFormat = streamLoadFormat; }
    
    @Override
    public String toString() {
        return "DorisConnectionConfig{" +
                "fenodes='" + fenodes + '\'' +
                ", benodes='" + benodes + '\'' +
                ", username='" + username + '\'' +
                ", database='" + database + '\'' +
                ", table='" + table + '\'' +
                ", readBatchSize=" + readBatchSize +
                ", batchSize=" + batchSize +
                ", batchIntervalMs=" + batchIntervalMs +
                '}';
    }
} 